﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AutomatedTP
{
    /// <summary>
    /// Class for storing information about stub function
    /// </summary>
    public class Stub : Func
    {
        private List<Operation> operations = new List<Operation>();
        //macro - wll be defined in Func.func_type but type is stub!!!
        private bool macro;

        /// <summary>
        /// Initializes a new instance of the <see cref="Stub"/> class.
        /// </summary>
        /// <param name="macro">if set to <c>true</c> [macro].</param>
        public Stub(bool macro = false) 
            : base("stub")
        {
            this.macro = macro;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Stub"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="ret_val">The ret_val.</param>
        /// <param name="ret_type">The ret_type.</param>
        /// <param name="num_of_param">The num_of_param.</param>
        /// <param name="input">The input.</param>
        /// <param name="macro">if set to <c>true</c> [macro].</param>
        public Stub(string name, string ret_val, string ret_type, int num_of_param, Dictionary<string, string> input, bool macro = false)
            : base(name, "stub", ret_val, ret_type, num_of_param, input)
        {
            this.macro = macro;
        }

        /// <summary>
        /// Gets the ops.
        /// </summary>
        /// <returns></returns>
        public List<Operation> GetOps()
        {
            return operations;
        }

        /// <summary>
        /// Gets the macro.
        /// </summary>
        /// <returns></returns>
        public bool GetMacro()
        {
            return macro;
        }


        /// <summary>
        /// Adds the op.
        /// </summary>
        /// <param name="op">The op.</param>
        public void AddOp(Operation op)
        {
            operations.Add(op);
        }

        /// <summary>
        /// Sets the macro.
        /// </summary>
        /// <param name="macro">if set to <c>true</c> [macro].</param>
        public void SetMacro(bool macro)
        {
            this.macro = macro;
        }

    }
}
